package com.hiwan.system.web.menu;
/**
 * @time 2015-11-06
 * @author lsb
 *
 */
public class TreeNode {
	//private final static String ICON_ORG = "ace-icon fa fa-university blue";
	//private final static String ICON_DEPT = "ace-icon fa fa-sitemap   green";
	//private final static String ICON_USER = "ace-icon fa fa-user grey";
	
	private String id;//编号
	private String pId;
	private String text;//节点的名字 显示的文字。 
	private String type;//节点的类型："item":文件  "folder":目录 
	private String nodeType;//是   机构还是部门 
	private String checked;//在支持checkbox的情况下，是否节点默认是否被选中 
	private String disabled;//在支持checkbox的情况下，能否被选择 
	private String attributes;//给一个节点追加的自定义属性。 
	private String cssClass;//显示icon的css样式.
	private String dataIcon;
	private String hasChildren;
	public TreeNode() {
	}
	/**
	 * 
	
	 * @return
	 */
	/**
	 * <p>封装的树节点信息</p>
	 * @param id 节点编号
	 * @param pId 父节点编号
	 * @param text	节点的名字 显示的文字。
	 * @param nodeType 	是  机构、部门、人员
	 * @param check  是否默认选中,默认false
	 * @param disabled 是否默认disable,默认false
	 * @param hasChildren 是否有子节点,默认false
	 * @return 一个节点
	 */
	public static TreeNode buildTreeNode(String id,String pId, String text,String nodeType,String check,String disabled,String hasChildren) {
		TreeNode node = new TreeNode();
		node.setId(id);
		node.setpId(pId==null?"00000":pId);
		node.setNodeType(nodeType);
		node.setText(text);
		node.setChecked(check);
		node.setDisabled(disabled);
		node.setHasChildren(hasChildren);
		if ("org".equals(nodeType)) {
			node.setType("folder");
		} else if ("dept".equals(nodeType)) {
			node.setType("item");
		} 
		return node;
	}
	public static TreeNode buildTreeNode(String id,String pId, String text,String nodeType) {
		return buildTreeNode(id,pId,text,nodeType,"false","false","false");
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getNodeType() {
		return nodeType;
	}
	public void setNodeType(String nodeType) {
		this.nodeType = nodeType;
	}
	public String getCssClass() {
		return cssClass;
	}
	public void setCssClass(String cssClass) {
		this.cssClass = cssClass;
	}
	public String getDataIcon() {
		return dataIcon;
	}
	public void setDataIcon(String dataIcon) {
		this.dataIcon = dataIcon;
	}
	public String getHasChildren() {
		return hasChildren;
	}
	public void setHasChildren(String hasChildren) {
		this.hasChildren = hasChildren;
	}
	public String getChecked() {
		return checked;
	}
	public void setChecked(String checked) {
		this.checked = checked;
	}
	public String getAttributes() {
		return attributes;
	}
	public void setAttributes(String attributes) {
		this.attributes = attributes;
	}
	public String getpId() {
		return pId;
	}
	public void setpId(String pId) {
		this.pId = pId;
	}
	public String getDisabled() {
		return disabled;
	}
	public void setDisabled(String disabled) {
		this.disabled = disabled;
	}
	
}
